package com.liushao.controller.admin;


import com.liushao.entity.LendItem;
import com.liushao.entity.LendReturn;
import com.liushao.result.Result;
import com.liushao.service.LendReturnService;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 还款记录表 前端控制器
 * </p>
 *
 * @author chen
 * @since 2025-01-03
 */
@RestController
@RequestMapping("/admin/core/lendReturn")
public class AdminLendReturnController {

    @Autowired
    private LendReturnService lendReturnService;

    /*
         url: `/admin/core/lendReturn/list/` + lendId,
      method: 'get'
     */

    @GetMapping("/list/{lendId}")
    public Result list(
            @ApiParam(value = "标的的id",required = true)
            @PathVariable Long lendId
    ){


        List<LendReturn> lendReturnList = lendReturnService.selectLendById(lendId);

        return  Result.ok().data("list",lendReturnList);
    }

}

